package com.boarsoft.flow.event;

import com.boarsoft.flow.core.SimpleFlow;

public interface SimpleFlowListener {
	void onError(SimpleFlow flow);

	void onSuspend(SimpleFlow flow);

	void onStop(SimpleFlow flow);

	void onTimeout(SimpleFlow flow);

	/**
	 * 流程开始执行前触发
	 * 
	 * @param flow
	 * @throws Throwable
	 */
	void onBegin(SimpleFlow flow);

	/**
	 * 当流程遇到END标识退出时（正常完成时）触发<br>
	 * 可以在此处对流程返回结果进行判断，修改返回码等
	 * 
	 * @param flow
	 */
	void onEnd(SimpleFlow flow);

	/**
	 * 流程步进
	 * 
	 * @param flow
	 */
	void onStep(SimpleFlow flow);
}
